<template>
  <div class="header">
    <el-form ref="form" :model="form">
      <div class="search">
        <el-form-item label="审核状态" class="label">
          <el-select placeholder="请选择审核状态" class="input" />
        </el-form-item>
        <el-form-item label="单元" class="label">
          <el-input v-model="form.name" class="input" placeholder="请输入单元号" />
        </el-form-item>
        <el-form-item label="门牌" class="label">
          <el-input v-model="form.name" class="input" placeholder="请输入门牌号" />
        </el-form-item>
        <el-form-item label="申报人" class="label">
          <el-input v-model="form.name" class="input" placeholder="请输入申报人姓名" />
        </el-form-item>

        <el-form-item>
          <el-button type="primary" size="mini" @click="onSubmit">查询</el-button>
        </el-form-item>
      </div>
    </el-form>
    <!-- 表格区域 -->
    <el-table
      :data="tableData"
      style="width: 100%"
      :header-cell-style="{background:'#ebecf0',color:'#3b3c3c'}"
    >
      <el-table-column type="index" label="序号" width="100" />
      <el-table-column prop="name" label="小区名称" />
      <el-table-column prop="door" label="单元门牌" />
      <el-table-column prop="person" label="申报人" />
      <el-table-column prop="time" label="提交时间" />
      <el-table-column label="审核状态">
        <template slot-scope="scope">
          <el-link type="warning" v-if="scope.row.status===0">待审核</el-link>
          <el-link type="success" v-else-if="scope.row.status===1">已通过</el-link>
          <el-link type="danger" v-else-if="scope.row.status===2">未通过</el-link>
        </template>
      </el-table-column>
      <el-table-column label="操作" width="100">
        <template slot-scope="scope">
          <el-button type="text" @click="showInfo(scope.row)">{{ scope.row.option==='0'?'审核':'查看' }}</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页 -->
    <div class="pagination">
      <el-pagination
        :current-page.sync="page"
        background
        :page-sizes="[10, 20, 30, 40]"
        layout="total, prev, pager, next, jumper"
        :total="total"
        @current-change="handleCurrentChange"
      />
    </div>

    <!-- 查看信息对话框 -->
    <el-dialog title :visible.sync="checkInfoDialogVisible" width="55%">
      <div class="dialog_box">
        <div class="dialog_content">
          <div class="dialog_title">申报信息</div>

          <el-form ref="form" :inline="true" :model="detail">
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="小区名称" class="label">
                  <el-input v-model="detail.community" class="input" />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="楼栋-门牌" class="label">
                  <el-input v-model="detail.door" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="户主姓名" class="label">
                  <el-input v-model="detail.time" class="input" />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="申报人姓名" class="label">
                  <el-input v-model="detail.applyer" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="户主身份证号" class="label">
                  <el-input v-model="detail.time" class="input" />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="申报人身份证号" class="label">
                  <el-input v-model="detail.applyer" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="户主手机号" class="label">
                  <el-input v-model="detail.time" class="input" />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="申报人手机号" class="label">
                  <el-input v-model="detail.applyer" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="房产证照片" class="label">
                  <el-image
                    style="width: 100px; height: 100px"
                    :src="url"
                    :fit="fit"
                    :preview-src-list="srcList"
                  />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="产权证号" class="label">
                  <el-input v-model="detail.applyer" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <div class="dialog_content">
          <div class="dialog_title">审核信息</div>
          <el-form ref="form" :inline="true" :model="detail">
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="审核人" class="label">
                  <el-input v-model="detail.community" class="input" />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="审核时间" class="label">
                  <el-input v-model="detail.door" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="审核状态" class="label">
                  <el-input v-model="detail.time" class="input" />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="审核备注" class="label">
                  <el-input v-model="detail.applyer" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
      </div>
    </el-dialog>
    <!-- 审核信息对话框 -->
    <el-dialog title :visible.sync="examineInfoDialogVisible" width="55%">
      <div class="dialog_box">
        <div class="dialog_content">
          <div class="dialog_title">审核信息</div>
          <el-form ref="form" :inline="true" :model="detail">
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="小区名称" class="label">
                  <el-input v-model="detail.community" class="input" />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="楼栋-门牌" class="label">
                  <el-input v-model="detail.door" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="户主姓名" class="label">
                  <el-input v-model="detail.time" class="input" />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="申报人姓名" class="label">
                  <el-input v-model="detail.applyer" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="户主身份证号" class="label">
                  <el-input v-model="detail.time" class="input" />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="申报人身份证号" class="label">
                  <el-input v-model="detail.applyer" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="户主手机号" class="label">
                  <el-input v-model="detail.time" class="input" />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="申报人手机号" class="label">
                  <el-input v-model="detail.applyer" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="产权证号" class="label">
                  <el-input v-model="detail.applyer" class="input" />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="房产证照片" class="label">
                  <el-image
                    style="width: 100px; height: 100px"
                    :src="url"
                    :fit="fit"
                    :preview-src-list="srcList"
                  />
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <div class="dialog_content">
          <div class="dialog_title">房主列表</div>
          <el-table
            :data="tableData"
            style="width: 100%"
            border
            :header-cell-style="{background:'#ebecf0',color:'#3b3c3c'}"
          >
            <el-table-column type="index" label="序号" width="100" />
            <el-table-column prop="name" label="姓名" />
            <el-table-column prop="door" label="类型" />
            <el-table-column prop="person" label="身份证号码" />
            <el-table-column prop="time" label="电话" />
            <el-table-column prop="time" label="最后更新时间" />
            <el-table-column label="操作" width="200">
              <template slot-scope="scope">
                <div class="related">
                  <img src="../../assets/一房一档slices/微信图片_20201207092659.png" alt class="record" />
                  <div>{{scope.row.cancle}}</div>
                </div>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <div class="dialog_content check">
          <div class="dialog_title">审核备注</div>
          <el-form>
            <el-form-item label="审核备注">
              <el-input type="textarea" placeholder="输入审核备注" />
            </el-form-item>
          </el-form>
        </div>
      </div>

      <div class="dialog-footer">
        <span slot="footer">
          <el-button @click="examineInfoDialogVisible = false">不通过</el-button>
          <el-button type="primary" @click="examineInfoDialogVisible = false">通过</el-button>
        </span>
      </div>
    </el-dialog>
    <!-- 二房东审核 -->
    <el-dialog title :visible.sync="twoexamineInfoDialogVisible" width="50%" class="twodialog">
      <div class="dialog_box">
        <div class="dialog_content">
          <div class="dialog_title">审核信息</div>
          <el-form ref="form" :inline="true" :model="detail">
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="小区名称" class="label">
                  <el-input v-model="detail.community" class="input" />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="单元-门牌" class="label">
                  <el-input v-model="detail.door" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="房主(代理人)姓名" class="label">
                  <el-input v-model="detail.time" class="input" />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="二房东姓名" class="label">
                  <el-input v-model="detail.applyer" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="房主(代理人)身份证" class="label">
                  <el-input v-model="detail.time" class="input" />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="二房东身份证" class="label">
                  <el-input v-model="detail.applyer" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="房主(代理人)电话" class="label">
                  <el-input v-model="detail.time" class="input" />
                </el-form-item>
              </el-col>
              <el-col :span="10" :offset="4">
                <el-form-item label="二房东电话" class="label">
                  <el-input v-model="detail.applyer" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form-item label="提交时间" class="label">
                  <el-input v-model="detail.applyer" class="input" />
                </el-form-item>
              </el-col>
            </el-row>
          </el-form>
        </div>
        <div class="dialog_content">
          <div class="dialog_title">房主列表</div>
          <el-table
            :data="tableData"
            style="width: 100%"
            border
            :header-cell-style="{background:'#ebecf0',color:'#3b3c3c'}"
          >
            <el-table-column type="index" label="序号" width="100" />
            <el-table-column prop="name" label="姓名" />
            <el-table-column prop="door" label="类型" />
            <el-table-column prop="person" label="身份证号码" />
            <el-table-column prop="time" label="电话" />
            <el-table-column prop="time" label="最后更新时间" />
            <el-table-column label="操作" width="200">
              <template slot-scope="scope">
                <div class="related">
                  <img src="../../assets/一房一档slices/微信图片_20201207092659.png" alt class="record" />
                  <div>{{scope.row.cancle}}</div>
                </div>
              </template>
            </el-table-column>
          </el-table>
        </div>
        <div class="dialog_content check">
          <div class="dialog_title">审核备注</div>
          <el-form>
            <el-form-item label="审核备注">
              <el-input type="textarea" placeholder="输入审核备注" />
            </el-form-item>
          </el-form>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="twoexamineInfoDialogVisible = false">不通过</el-button>
        <el-button type="primary" @click="twoexamineInfoDialogVisible = false">通过</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: "House",
  components: {},
  data() {
    return {
      form: {},
      checkform: {},
      tableData: [
        {
          time: "2016-05-02",
          name: "弄堂加油",
          door: "1888",
          person: "jyb",
          option: "0",
          status: 0,
          cancle: "取消人房关联",
          power: 0
        },
        {
          time: "2016-05-02",
          name: "弄堂加油",
          door: "1888",
          person: "jyb",
          option: "0",
          status: 0,
          cancle: "取消人房关联",
          power: 1
        },
        {
          time: "2016-05-02",
          name: "弄堂加油",
          door: "1888",
          person: "jyb",
          option: "1",
          status: 1,
          cancle: "取消人房关联",
          power: 1
        },
        {
          time: "2016-05-02",
          name: "弄堂加油",
          door: "1888",
          person: "jyb",
          option: "1",
          status: 2,
          cancle: "取消人房关联",
          power: 1
        }
      ],
      detail: {
        name: "张扬阳",
        sex: "男",
        community: "新丰苑三期",
        door: "1-301",
        address: "江苏-无锡",
        time: "2020-10-23 12:23:12",
        applyer: "王浩",
        reviewer: "周华东"
      },
      total: 100,
      page: 10,
      //   弹出查看信息对话框
      checkInfoDialogVisible: false,
      // 审核信息对话框
      examineInfoDialogVisible: false,
      // 二房东审核
      twoexamineInfoDialogVisible: false,
      url:
        "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
      srcList: [
        "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg",
        "https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
      ]
    };
  },
  computed: {},
  watch: {},
  created() {},
  methods: {
    //   点击查询按钮
    onSubmit() {
      console.log(1);
    },
    //   当前页改变
    handleCurrentChange() {
      console.log(2);
    },
    showInfo(row) {
      if (row.status === 0) {
        if (row.power === 0) {
          // 房东审核
          this.examineInfoDialogVisible = true;
        } else {
          this.twoexamineInfoDialogVisible = true;
        }
      } else {
        this.checkInfoDialogVisible = true;
      }
    }
  }
};
</script>
<style lang="scss" scoped>
.header {
  background: #ffffff;
  padding: 25px;
  padding-bottom: 100px;
  min-height: 800px;
  position: relative;
  .search {
    display: flex;
    align-items: flex-end;
    border-bottom: 2px solid #dcdee3;
    margin-bottom: 30px;
  }
  .input {
    width: 346px;
  }
  .label {
    display: block;
    text-align: left;
    margin-right: 22px;
    color: #666666;
    font-size: 15px;
    width: 100%;
  }
  .pagination {
    position: absolute;
    right: 0;
    bottom: 0;
    margin: 50px;
  }
}
.related {
  position: relative;
  padding: 0 24px;
  border: 1px solid #0476ff;
  width: 140px;
  height: 20px;
  color: #0476ff;
  .record {
    position: absolute;
    top: 17%;
    left: 5%;
  }
}

.check {
  margin-top: 30px;
}
.dialog-footer {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 15px;
}
</style>

<style scoped>
.el-dialog .el-dialog__header {
  padding-top: 0;
}
.el-dialog .el-dialog__body {
  padding: 20px 15px !important;
}
.twodialog /deep/.el-dialog__header {
  padding: 10px!important;
}
.twodialog /deep/.el-dialog__body {
  padding: 20px 15px !important;
}
</style>



